/** 
 * LogFrame.java
 * @author Lex
 * 2007-8-17 ����12:19:54
 */
package fun.ui.frames;

import fun.ui.FunMainFrame;
import fun.util.Log;

/**
 * ��ʾ��־
 */
public class LogFrame extends TextAreaFrame implements Log {
	/*
	 * @see my.util.Log#error(java.lang.Object)
	 */
	public Log error(Object msg) {
		return this.print("[ERROR] ").print(msg);
	}

	/*
	 * @see my.util.Log#fine(java.lang.Object)
	 */
	public Log fine(Object msg) {
		return this.print("[FINE] ").print(msg);
	}

	/*
	 * @see my.util.Log#info(java.lang.Object)
	 */
	public Log info(Object msg) {
		return this.print("[INFO] ").print(msg);
	}

	public LogFrame(FunMainFrame mainframe) {
		super(mainframe);
		this.setTitle("Log");
	}

	private LogFrame print(Object msg) {
		this.getTextArea().append(String.valueOf(msg));
		return this;
	}
}
